import { Entity, Column, PrimaryColumn , ManyToOne , OneToMany, OneToOne } from 'typeorm';
import { Leagues } from './leagues';
import { Teams } from './teams';
import { NBAData } from './nba_data';

@Entity()
class Players {

    @PrimaryColumn({
        type: "varchar",
        length: 12,
        comment: "球员id"
    })
    id: string;

    // /media/img/players/head/260x190/${id}.png
    @Column({
        type: "varchar",
        length: 255,
        comment: "球员头像地址"
    })
    avatar: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "球员code"
    })
    code: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "国家名"
    })
    country: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "国家名 英文"
    })
    countryEn: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "显示国籍 英文"
    })
    displayAffiliation: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "显示名字"
    })
    displayName: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "显示名字 英文"
    })
    displayNameEn: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "暂时不知道啥意思"
    })
    dob: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "选秀年份"
    })
    draftYear: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "生涯时长"
    })
    experience: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "名"
    })
    firstInitial: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "名"
    })
    firstName: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "名 英文"
    })
    firstNameEn: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "身高"
    })
    height: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "号码"
    })
    jerseyNo: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "姓"
    })
    lastName: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "姓 英文"
    })
    lastNameEn: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "位置"
    })
    position: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "学校类型"
    })
    schoolType: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "体重"
    })
    weight: string;

    @ManyToOne(type => Leagues)
    league: Leagues;

    @ManyToOne(type => Teams)
    teams: Teams;

    // @ManyToOne(type => Leagues, leagues => leagues.id)
    // leagues: Leagues;

    // @ManyToOne(type => Teams,teams => teams.id)
    // teams: Teams;

    // @OneToMany(type => NBAData,nbaData => nbaData.players)
    // nbaData: NBAData;

}

export { Players };